import request from '@/utils/request.js'
import store from '@/store'
import config from '@/utils/config.js'

/**
 *   工作票主票
 */
export function getWorkticketDetail(wtId) {
	const params = {
		wtId
	}
	return request.get({
		url: config.baseUrl +'/twotickets/v1/api/wt-work-ticket/detail',
		params
	});
}
/**
 * @param {Object} stdWtid
 * 标准工作篇主票
 */
export function getWtstdWorkticketDetail(stdWtId) {
	const params = {
		stdWtId
	}
	return request.get({
		url: config.baseUrl +'/twotickets/v1/api/wt-std-workticket/detail',
		params
	});
}
/**
 *  获取工作票类型基本信息
 */
export function getWttypeDetail(wtTypeId) {
	const params = {
		wtTypeId
	}
	return request.get({
		url: config.baseUrl +'/twotickets/v1/api/wt-type/detail',
		params
	});
}

/**
 * 工作票安全措施类型
 * http://112.4.136.182:5100/ibps/twotickets/v1/api/wt-type-safemeasure/page?current=1&size=10
 */
export function getSafemeasure(current,size) {
	const params = {
		current,size
	}
	return request.get({
		url: config.baseUrl +'/twotickets/v1/api/wt-type-safemeasure/page',
		params
	});
}

/**
 * http://112.4.136.182:5100/ibps/twotickets/v1/api/wt-hazard-control/page?current=1&objId=1330809488738906114&objNo=WT&size=10
 */
export function getWtHazardControl(objId,objNo,current,size) {
	const params = {
		objId,objNo,current,size
	}
	return request.get({
		url: config.baseUrl +'/twotickets/v1/api/wt-hazard-control/page',
		params
	});
}